package com.litian.dancechar.gateway.handler;

import com.litian.dancechar.gateway.job.RefreshWhiteBlackListJob;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * 系统启动加载类
 *
 * @author litian
 * @date 2021/6/22 09:51
 */
@Component
@Order(value = 1)
@Slf4j
public class StartLoaderHandler implements ApplicationRunner {
    @Resource
    private RefreshWhiteBlackListJob refreshTask;

    @Override
    public void run(ApplicationArguments args) {
        log.info("#######################################系统初始化#######################################");
        // 刷新初始化数据进内存
        refreshTask.refresh();
        log.info("#######################################初始化完成#######################################");
    }
}
